package com.ujiuye.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    //字符串转日期 -->解析
    public static Date strToDate(String d){
        SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd");
        try {
           return  sdf.parse(d);
        } catch (ParseException e) {
            e.printStackTrace();
            throw  new RuntimeException();
        }
    }
}
